package mysql

import "gorm.io/gorm"

type Course struct {
	gorm.Model
	UserId      int     `gorm:"type:int(10);not null;comment:'用户id'"`
	CourseName  string  `gorm:"type:varchar(100);not null;comment:'课程名称'"`
	CoursePrice float64 `gorm:"type:double(10,2);not null;comment:'课程价格'"`
	CourseInter string  `gorm:"type:varchar(255);not null;comment:'课程描述'"`
	CourseTime  string  `gorm:"type:varchar(50);not null;comment:'课程时间段'"`
	CourseCoach string  `gorm:"type:varchar(11);not null;comment:'教练'"`
}

func CourseShow(id int) (result *Course, err2 error) {
	DB.Debug().Where("id = ?", id).Limit(1).Find(&result)
	return
}
